package com.bestcem.xm.deliver.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bestcem.xm.component.mybatis.base.BaseEntity2;
import com.bestcem.xm.component.mybatis.format.String2JacksonSerializer;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @TableName ds_deliver_disturbrule
 */
@TableName(value = "ds_deliver_disturbrule")
@Data
@EqualsAndHashCode(callSuper = true)
public class DeliverDisturbRule extends BaseEntity2 {
    @TableId(value = "id")
    @JSONField(name = "_id")
    private String id;

    /**
     * 组织ID
     */
    @TableField(value = "org_id")
    @JsonProperty("orgID")
    private String orgId;

    /**
     * 是否启用该条规则
     */
    @TableField(value = "enable")
    private Boolean enable;

    /**
     * 免打扰类型
     */
    @TableField(value = "ttype")
    private Integer ttype;

    /**
     * 项目免打扰对应所属项目
     */
    @TableField(value = "survey_id")
    @JsonProperty("survey_id")
    @JSONField(name = "survey_id")
    private String surveyId;

    /**
     * 免打扰时间范围
     */
    @TableField(value = "period_type")
    @JsonProperty("period_type")
    @JSONField(name = "period_type")
    private Integer periodType;

    /**
     * 免打扰时间范围为指定天数时的具体天数值
     */
    @TableField(value = "days")
    private Integer days;

    /**
     * 行为
     */
    @TableField(value = "op_type")
    @JsonProperty("op_type")
    @JSONField(name = "op_type")
    private Integer opType;

    /**
     * 免打扰问卷id list
     */
    @TableField(value = "disturb_survey_ids")
    @JsonProperty("disturb_survey_ids")
    @JsonSerialize(using = String2JacksonSerializer.class)
    @JSONField(name = "disturb_survey_ids")
    private String disturbSurveyIds;

    /**
     * 频次限制
     */
    @TableField(value = "limit_times")
    @JsonProperty("limit_times")
    @JSONField(name = "limit_times")
    private Integer limitTimes;
}